package http

import (
	"gitee.com/saxon134/workflow/controller"
	"github.com/gin-gonic/gin"
)

func initRoutes(group *gin.RouterGroup) {
	Post(group, "upload.file", controller.Upload, AuthSign)

	Post(group, "user.login", controller.UserLogin, AuthSign)
	Gett(group, "user.list", controller.UserList, AuthMs)
	Gett(group, "user.menus", controller.UserMenus, AuthMs)
	Post(group, "user.save", controller.UserSave, AuthMs)
	Post(group, "user.modify", controller.UserModify, AuthMs)

	Gett(group, "project.list", controller.ProjectList, AuthMs)
	Gett(group, "project.brief", controller.ProjectBrief, AuthMs)
	Post(group, "project.save", controller.ProjectSave, AuthMs)

	Gett(group, "demand.list", controller.DemandList, AuthMs)
	Gett(group, "demand", controller.DemandDetail, AuthMs)
	Post(group, "demand.add", controller.DemandAdd, AuthMs)
	Post(group, "demand.update", controller.DemandUpdate, AuthMs)

	Gett(group, "demand.tag.list", controller.TagList, AuthMs)
	Post(group, "demand.tag.save", controller.TagSave, AuthMs)

	Gett(group, "demand.chat.list", controller.ChatList, AuthMs)
	Post(group, "demand.chat.save", controller.ChatSave, AuthMs)
	Post(group, "demand.chat.update", controller.ChatUpdate, AuthMs)
	Post(group, "demand.chat.resource.update", controller.ResourceUpdate, AuthMs)

	Gett(group, "job.list", controller.JobList, AuthMs)
	Post(group, "job.save", controller.JobSave, AuthMs)

	Gett(group, "bug.list", controller.BugList, AuthMs)
	Post(group, "bug.save", controller.BugSave, AuthMs)
	Post(group, "bug.update", controller.BugUpdate, AuthMs)

	//todo
	Gett(group, "case.list", Index, AuthMs)
	Gett(group, "dashboard", Index, AuthMs)
}
